// i18n配置文件
import { createI18n } from "vue-i18n";
import en from "./en";
import zhHans from "./zh-Hans.json";
import zhHant from "./zh-Hant.json";

const systemLanguage = localStorage.getItem('language') || 'zh-Hans';

localStorage.setItem('language', systemLanguage);

const messages = {
    en,
    "zh-Hans": zhHans,
    "zh-Hant": zhHant,
};

const i18n = createI18n({
    locale: systemLanguage,
    fallbackLocale: "zh-Hans",
    messages: messages,
});

export default i18n;